{template 'common/header'}
<link rel="stylesheet" type="text/css" href="../addons/yzzc_sun_plugin_distribution/template/style/style.css">
<ul class="we7-page-tab">
	<li class="active"><a>佣金设置</a></li>
</ul>
<div class="clearfix">
	{if $info["status"]>0}
		<form action="" method="post" class="we7-form" enctype="multipart/form-data" id="form1">
			<input type="hidden" name="id" value="{$info['id']}">
			<div class="form-group">
				<label class="col-sm-2 control-label">分销佣金类型：</label>
				<div class="col-sm-8 form-control-static" id="changecommissiontype">
					<input type="radio" name="indata[commissiontype]" id="commissiontype-1" {if $info['commissiontype']==1 || empty($info['commissiontype'])}checked="checked"{/if} value="1">
					<label class="radio-inline" for="commissiontype-1">百分比</label>
					<input type="radio" name="indata[commissiontype]" id="commissiontype-2" {if $info['commissiontype']==2}checked="checked"{/if} value="2">
					<label class="radio-inline" for="commissiontype-2">固定金额</label>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">一级：</label>
				<div class="col-sm-8 form-control-static">
					<input type="text" class="form-control" name="indata[firstname]" value="{if $info['firstname']}{$info['firstname']}{else}一级{/if}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">一级佣金：</label>
				<div class="col-sm-8 form-control-static">
					<input type="text" class="form-control" name="indata[firstmoney]" value="{$info['firstmoney']}"><span class="money_str">{if $info['commissiontype']==1}%{else}元{/if}</span>
				</div>
			</div>
			{if $info["status"]>=2}
				<div class="form-group">
					<label class="col-sm-2 control-label">二级：</label>
					<div class="col-sm-8 form-control-static">
						<input type="text" class="form-control" name="indata[secondname]" value="{if $info['secondname']}{$info['secondname']}{else}二级{/if}">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">二级佣金：</label>
					<div class="col-sm-8 form-control-static">
						<input type="text" class="form-control" name="indata[secondmoney]" value="{$info['secondmoney']}"><span class="money_str">{if $info['commissiontype']==1}%{else}元{/if}</span>
						<div></div>
					</div>
				</div>
			{/if}
			{if $info["status"]>=3}
				<div class="form-group">
					<label class="col-sm-2 control-label">三级：</label>
					<div class="col-sm-8 form-control-static">
						<input type="text" class="form-control" name="indata[thirdname]" value="{if $info['thirdname']}{$info['thirdname']}{else}三级{/if}">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">三级佣金：</label>
					<div class="col-sm-8 form-control-static">
						<input type="text" class="form-control" name="indata[thirdmoney]" value="{$info['thirdmoney']}"><span class="money_str">{if $info['commissiontype']==1}%{else}元{/if}</span>
						<div></div>
					</div>
				</div>
			{/if}
			<div class="form-group">
				<input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
				<input type="hidden" name="token" value="{$_W['token']}" />
			</div>
		</form>
		<script type="text/javascript">
			$(function(){
				$("#changecommissiontype").on("click",function(){
					var a = $("#changecommissiontype input[name='indata[commissiontype]']:checked").val();
					console.log(a);
					var b = a=="1"?"%":"元";
					$(".money_str").text(b);
				})
			})
		</script>
	{else}
		<div>请先开启分销等级</div>
	{/if}
</div>
{template 'common/footer'}